package com.zb.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zb.entity.ZjWorkDispatchNetwork;
import com.zb.extend.NetworkDispatchOrderListExtend;
import com.zb.mobile.NetworkMobileOrderListSelectVo;
import com.zb.mobile.NetworkMobileOrderMessageListSelectVo;
import com.zb.mobile.NetworkOrderStatusQtyVo;
import com.zb.result.PageUtil;
import com.zb.view.ViewNetworkEmpDetail;

import java.util.Collection;
import java.util.List;

/**
 * <p>
 * 工单分派网点表 服务类
 * </p>
 *
 * @author WEN
 * @since 2023-10-23
 */
public interface ZjWorkDispatchNetworkService extends IService<ZjWorkDispatchNetwork> {
    /**
     * 保存工单分派服务商
     * @param custAccId 商家ID
     * @param workId 工单ID
     * @param networkId 服务商ID
     */
    void save(Long custAccId, Long workId, Long networkId);

    /**
     * 根据ID更新重复派单的派单记录
     * @param updateDispatchNetwork
     */
    void updateRepeatDispatchOrderById(List<ZjWorkDispatchNetwork> updateDispatchNetwork);

    /**
     * 根据ID更新重复派单的派单记录
     * @param updateDispatchNetwork
     */
    void updateRepeatDispatchOrderById(ZjWorkDispatchNetwork updateDispatchNetwork);

    /**
     * 根据工单ID获取服务商信息
     * @param workId 工单ID
     * @return
     */
    ZjWorkDispatchNetwork getByWorkId(Long workId);

    /**
     * 根据服务商ID分页获取工单ID
     * @param networkId 服务商ID
     * @param selectVo 分页对象
     * @return
     */
    List<Long> getWorkIdByNetworkId(Long networkId, NetworkMobileOrderMessageListSelectVo selectVo);

    /**
     * 根据服务商ID & 工单ID获取工单分派服务商信息
     * @param networkId 服务商ID
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkDispatchNetwork> getByNetworkIdAndWorkIds(Long networkId, List<Long> workIds);

    /**
     * 根据工单ID与服务商ID获取派单信息
     * @param workId 工单ID
     * @param networkId 服务商ID
     * @return
     */
    ZjWorkDispatchNetwork getByWorkIdAndNetowrkId(Long workId, Long networkId);

    /**
     * 获取服务商移动端工单列表
     * @param networkId 服务商ID
     * @param selectVo 搜索条件
     * @return
     */
    List<NetworkDispatchOrderListExtend> getNetworkOrderList(Long custAccId, Long networkId, NetworkMobileOrderListSelectVo selectVo);

    /**
     * 获取服务商工单列表状态数量
     * @param custAccId 商家ID
     * @param networkId 服务商ID
     * @param keyword 搜索关键词：工单单号/一物一码/产品名称/产品型号
     * @return
     */
    NetworkOrderStatusQtyVo getNetworkOrderListStatusQty(Long custAccId, Long networkId, String keyword);

    /**
     * 获取服务商移动端工单列表总记录数
     * @param networkId 服务商ID
     * @param selectVo 搜索条件
     * @return
     */
    long getNetworkOrderListCount(Long custAccId, Long networkId, NetworkMobileOrderListSelectVo selectVo);

    /**
     * 根据工单ID与服务商ID查询已存在的工单
     * @param networkId 服务商ID
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkDispatchNetwork> getOrderDispatchHistoryByWorkIdsAndNetworkId(Long networkId, List<Long> workIds);

    /**
     * 根据工单ID获取服务商待接单的工单
     * @param workIds 工单ID
     * @return
     */
    List<ZjWorkDispatchNetwork> getWaitReceiveOrderByWorkIds(List<Long> workIds);


}
